package org.cem.security;

import javax.security.auth.Subject;

public class Permission {
	
	public static final String BACKEND_ACCESS = "org.cem.security.permission.backendAccess";
	public static final String ELECTION_ACCESS = "org.cem.security.permission.electionAccess";
	
	public static boolean hasPermission(Subject subject, String permission) {
		PermissionPrincipal permissionPrincipal = new PermissionPrincipal(permission);
		return subject.getPrincipals().contains(permissionPrincipal);
	}
}
